package com.alfred.springboot.elasticjob.listener;

import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener;
import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class MyElasticJobListener implements ElasticJobListener {
    @Override
    public void beforeJobExecuted(ShardingContexts shardingContexts) {
        log.error("beforeJobExecuted========="+shardingContexts.getJobName());
    }

    @Override
    public void afterJobExecuted(ShardingContexts shardingContexts) {
        log.error("afterJobExecuted========="+shardingContexts.getJobName());
    }

    @Override
    public String getType() {
        return "myElasticJobListener";
    }
}
